<div class="post">
    <div class="title nav">
        <?php echo CHtml::link(CHtml::encode($data->title), $data->url); ?>
    </div>
    <div class="author">
        <?php echo CHtml::encode(Yii::t('site','posted by {username} on {date}',array('{username}'=>$data->author->getFullName(getClassConst('User','NAMETYPE_LAST_C_FIRST1')),'{date}'=>Yii::app()->dateFormatter->formatDateTime($data->create_time,'medium','short')))); ?>
    </div>
    <div class="intro">
        <?php
            $this->beginWidget('CMarkdown', array('purifyOutput'=>true));
            echo $data->intro;
            $this->endWidget();
        ?>
    </div>
    <?php if(!isset($_GET['post']['show_content']) and trim($data->content)!=='') : ?>
    <p>
        <?php echo '&nbsp;&nbsp;&rArr;&nbsp;'.CHtml::link(Yii::t('site','Read more...'),array('/post/view','id'=>$data->id,'post[show_content]'=>1)); ?>
    </p>
    <?php else : ?>
    <div class="content">
        <?php
            $this->beginWidget('CMarkdown', array('purifyOutput'=>true));
            echo $data->content;
            $this->endWidget();
        ?>
    </div>
    <?php endif; ?>
    <div class="nav">
        <b><?php echo CHtml::encode(Yii::t('site','Tags:')); ?></b>
        <?php echo implode(', ', $data->tagLinks); ?>
        <br/>
        <?php echo Yii::app()->user->checkAccess('admin') ? CHtml::link(ICON_EDIT,array('/post/update','id'=>$data->id)) : ''; ?>
        <?php echo CHtml::link('Permalink', $data->url); ?> |
        <?php echo CHtml::link(Yii::t('site','Comments ({commentsCount})',array('{commentsCount}'=>$data->commentCount)),$data->url.'#comments'); ?> |
        <?php echo CHtml::encode(Yii::t('site','Last updated on {date}',array('{date}'=>Yii::app()->dateFormatter->formatDateTime($data->update_time,'medium','short')))); ?>
    </div>
</div>
